'use strict';

const Controller = require('egg').Controller;

// const { execute } = require("../../scripts/helloworld")

class FormDataSourceController extends Controller {
  async getDataPort () {
    const { ctx } = this;
    const dataPortList = await this.ctx.service.formDataSource.getDataPort();
    this.ctx.body = {
      code: 200,
      data: dataPortList,
    };
  }
  async getParamReturn () {
    const { ctx } = this;
    const { id } = ctx.query;
    const dataPortList = await this.ctx.service.formDataSource.getParamReturn(id);
    this.ctx.body = {
      code: 200,
      data: dataPortList,
    };
  }


  async getDataSource () {
    const { ctx } = this;
    const { id } = ctx.query;
    const dataSorceList = await this.ctx.service.formDataSource.getDataSource(id);
    this.ctx.body = {
      code: 200,
      data: dataSorceList,
    };
  }


}

module.exports = FormDataSourceController;
